package com.wyh.spring.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:计算两个整数相加
 * User: 王圆豪
 * Date: 2025-07-01
 * Time: 10:33
 */
@RestController
@RequestMapping("/calc")
public class CalcController {
    @RequestMapping("/sum")
    public String sum(Integer num1, Integer num2){
        if (num1 == null || num2 == null){
            return "输入有误";
        }
        Integer ret = num1 + num2;
        return "计算机计算结果：" + ret;
    }
}
